package heima_design.model09;

public class Singleton_solve {
	//私有构造方法
	private Singleton_solve() {
	}
	
	private static class SingletonHolder {
		private static final Singleton_solve INSTANCE = new Singleton_solve();
	}
	
	//对外提供静态方法获取该对象
	public static Singleton_solve getInstance() {
		return Singleton_solve.SingletonHolder.INSTANCE;
	}
	/**
	 * 下面是为了解决序列化反序列化破解单例模式
	 */
	private Object readResolve(){
		return SingletonHolder.INSTANCE;
	}
}
